package com.sk.skplanet.commute.actions;

import java.util.Comparator;

import android.widget.LinearLayout;
import android.widget.TextView;

import com.sk.skplanet.commute.R;

public class comp implements Comparator<LinearLayout> {
	public int compare(LinearLayout o1, LinearLayout o2) {
		int result = 0;
		TextView t1 = (TextView) o1.findViewById(R.id.textview_arrivaltime);
		TextView t2 = (TextView) o2.findViewById(R.id.textview_arrivaltime);

		long time1 = Integer.parseInt(t1.getTag().toString());
		long time2 = Integer.parseInt(t2.getTag().toString());

		if (time1 < time2) {
			result = -1;
		} else if (time1 > time2) {
			result = 1;
		} else {
			result = 0;
		}

		return result;
	}
}
